import smtplib
from email.mime.text import MIMEText
from email.header import Header


def send():
    message = MIMEText('test！', 'plain', 'utf-8')
    message['From'] = Header("17040407@cnsuning.com", 'utf-8')
    message['To'] = Header("17040407@cnsuning.com", 'utf-8')

    subject = '系统邮件，请勿回复'
    message['Subject'] = Header(subject, 'utf-8')
    server = smtplib.SMTP('smtp.cnsuning.com')
    server.sendmail('17040407@cnsuning.com', '17040407@cnsuning.com', message.as_string())
    server.quit()


if __name__ == '__main__':
    send()
